﻿<UserControl x:Class="SSDM.DocumentingDB.SelectTableWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:Localizer="clr-namespace:SSDM.Bases"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <StackPanel>
            <ListBox Name="listControl"
                 MinWidth="100" MinHeight="100"
                 MaxWidth="300" MaxHeight="500"
         ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                SelectionMode="Multiple">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel />
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate>
                    <DataTemplate >
                        <StackPanel Orientation="Horizontal"
                        MinWidth="150" MaxWidth="350"
                        Margin="0,5, 0, 5" >
                            <CheckBox
                    Name="checkedListBoxItem"
                    IsChecked="{Binding
                            RelativeSource={RelativeSource FindAncestor,
                            AncestorType={x:Type ListBoxItem} },
                            Path=IsSelected, Mode=TwoWay}" />
                            <ContentPresenter
                    Content="{Binding
                            RelativeSource={RelativeSource TemplatedParent},
                            Path=Content}"
                    Margin="5,0, 0, 0" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <CheckBox IsChecked="False" HorizontalAlignment="Center" x:Name="chkCheckAllTable"
                      Checked="CheckBox_Checked" Unchecked="chkCheckAllTable_Unchecked" Content="{Localizer:Translate TitleSelectAll}" Margin="10"/>
        </StackPanel>
    </Grid>
</UserControl>
